<?php
/*
 * Created on Jan 3, 2008
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
require('./View/Security.php');
require('./Model/SpecalizedInserts.php');
require('./Controller/UpdateBackEnd.php');
if($updateHasBeenRun) {
	echo "Update Sucssful</br>";
}
if($_COOKIE['home'] =='Home') {
	$back = 'Home.php';
} elseif($_COOKIE['home'] == 'AdminHome') {
	$back = 'AdminHome.php';
}
	$update = "ViewGeneric.php?" . $_SERVER['QUERY_STRING'];
 if(isset($_GET['CellTypeID'])) {
 	$table = "CellType";
 	$id = $_GET['CellTypeID'];
 	$search="CellTypeID=$id";
 } elseif(isset($_GET['ModificationID'])) {
 	$table ="Modification";
 	$id = $_GET['ModificationID'];
 	$search="ModifiedByID=$id";
 } elseif(isset($_GET['ResearcherID'])) {
 	$table = "Researcher";
 	$id = $_GET['ResearcherID'];
 	$search="FrozenByID=$id";
 }
?>
<!-- Maybe make this alternate a link between Home and Admin Home -->
<a href=<?php echo $back ?>?<?php echo $search ?>>Find all items of this type</a>
<form name="update" action="<?php echo $update ?>" method="post" onsubmit="return validate_form(this)">
	<input type="hidden" name="table" value="<?php echo $table ?>">
	<input type="hidden" name="size" value="1"> 
		<?php require('./View/View' . $table . '.php'); ?>
	<input type="hidden" name="1[id]" value="<?php echo $id  ?>">
	<?php if(!isset($_COOKIE['Guest'])): ?>
	<input type="submit" name="update" value="Update Table">
	<?php endif; ?>
</table>
</form>